package com.mowh.multithreading.active.object.executors;

import com.mowh.multithreading.active.object.executors.active.object.ActiveObject;
import com.mowh.multithreading.active.object.executors.active.object.ActiveObjectFactory;

/**
 * @author mowh1gd
 * @create 2023/11/30 11:03
 */
public class Main {
    public static void main(String[] args) {
        ActiveObject activeObject = ActiveObjectFactory.createActiveObject();
        try {
            new MakerClientThread("Alice", activeObject).start();
            new MakerClientThread("Bobby", activeObject).start();
            new DisplayClientThread("Chris", activeObject).start();
            Thread.sleep(5000);
        } catch (InterruptedException e) {
        } finally {
            System.out.println("*** shutdown ***");
            activeObject.shutdown();
        }
    }
}
